<include file="public@header"/>
</head>

<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:url('goods/index')}">商品列表</a></li>
        <li class="active"><a href="#">商品编辑</a></li>
    </ul>
    <form class="form-horizontal js-ajax-form margin-top-20" role="form" action="{:url('goods/edit')}"
          method="post">
          <input type="hidden" name="id" value="{$info['id']}">
        <fieldset>
            <div class="tabbable">
                <div class="tab-content">
                    <div class="tab-pane active" id="A">
                        <div class="form-group">
                            <label for="input-site-name" class="col-sm-2 control-label">商品分类</label>
                            <div class="col-md-3 col-sm-5">
                                <select name="cateId" class="form-control">
                                    <foreach name="cate" item="vo">
                                    <option <if condition="$info['cateId'] eq $vo['id']"> selected </if> value="{$vo.id}">{$vo.name}</option>
                                    </foreach>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="input-site-name" class="col-sm-2 control-label">商品名称</label>
                            <div class="col-md-3 col-sm-5">
                                <input type="text" class="form-control" name="name"
                                       value="{$info['name']}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="input-site-name" class="col-sm-2 control-label">商品现价</label>
                            <div class="col-md-3 col-sm-5">
                                <input type="text" class="form-control" name="price"
                                       value="{$info['price']}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="input-site-name" class="col-sm-2 control-label">商品原价</label>
                            <div class="col-md-3 col-sm-5">
                                <input type="text" class="form-control" name="old_price"
                                       value="{$info['old_price']}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="input-site-name" class="col-sm-2 control-label">商品销量</label>
                            <div class="col-md-3 col-sm-5">
                                <input type="text" class="form-control" name="sales"
                                       value="{$info['sales']}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="input-site-name" class="col-sm-2 control-label">商品规格</label>
                            <div class="col-md-3 col-sm-5">
                                <input type="text" class="form-control" name="para"
                                       value="{$info['para']}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="input-site-name" class="col-sm-2 control-label">商品规格1</label>
                            <div class="col-md-3 col-sm-5">
                                <input type="text" class="form-control" name="para1"
                                       value="{$info['para1']}">
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="input-site-name" class="col-sm-2 control-label">商品详情</label>
                            <div class="col-md-3 col-sm-5">
                                <script type="text/plain" id="content" name="content">{$info['content']}</script>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="input-site-name" class="col-sm-2 control-label">首页推荐</label>
                            <div class="col-md-3 col-sm-5">
                                <select name="is_public" class="form-control">
                                    <option <if condition="$info['is_public'] eq 1"> selected </if> value="1">--不推荐--</option>
                                    <option <if condition="$info['is_public'] eq 2"> selected </if> value="2">--推荐--</option>
                                </select>
                            </div>
                        </div>
                        <div class="form-group">
                            <label for="input-site-name" class="col-sm-2 control-label">商品图片</label>
                            <div class="col-md-3 col-sm-5">
                                <input id="photo-1" type="hidden" name="img">
                                <input id="photo-1-name"  class="form-control" name="photo_name" value="{$info['img']}">
                                <img id="photo-1-preview" style="width:150px;height:150px;" src="{$info['img']}">
                                <a href="javascript:uploadOneImage('图片上传','#photo-1');">上传</a>
                            </div>
                        </div>
                        
                        <div class="form-group">
                            <div class="col-sm-offset-2 col-sm-10">
                                <button type="submit" style="width:150px;" class="btn btn-primary">
                                    {:lang('SAVE')}
                                </button>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </fieldset>
    </form>

</div>
<script type="text/javascript" src="__STATIC__/js/admin.js"></script>
<script href="__STATIC__/js/Jquery/jquery.js" /></script>
<script type="text/javascript">
    window.UEDITOR_HOME_URL = "__STATIC__/js/ueditor/";    //UEDITOR_HOME_URL、config、all这三个顺序不能改变(绝对路径)
</script>
<load href="__STATIC__/js/ueditor/ueditor.config.js" /></script>
<load href="__STATIC__/js/ueditor/ueditor.all.min.js" />
<script type="text/javascript">
    $(function(){
        var ueditor;
            //具体参数配置在  editor_config.js  中
        var options = {
            initialFrameWidth:700,        //初化宽度
            initialFrameHeight:300,        //初化高度
            focus:false,                        //初始化时，是否让编辑器获得焦点true或false
            maximumWords:1000,        //允许的最大字符数
        };
        ueditor = new UE.ui.Editor(options);
        ueditor.render("content");
        
    });    
    </script>
</body>
</html>
